package com.cloudfun.campusshare.entity;

import com.cloudfun.campusshare.common.constant.PayPlatform;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.time.LocalDate;

/**
 * @author : zhangyongjie
 * @version : 1.0
 * @createTime : 2020/6/1 16:22
 * @description :
 */
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "daily_balance_account")
public class DailyBalanceAccountEntity {
    @Id
    @GenericGenerator(name = "id_uuid", strategy = "uuid")
    @GeneratedValue(generator = "id_uuid")
    @Column(name = "id", unique = true, columnDefinition = ("varchar(40) not null comment '主键uuid'"))
    private String id;

    @Column(name = "balance_account_no", unique = true, columnDefinition = ("varchar(32) not null comment '结算单号'"))
    private String balanceAccountNo;

    @Column(name = "bill_date", columnDefinition = ("date not null comment '账单日期'"))
    private LocalDate billDate;

    @Column(name = "journal_amount", columnDefinition = ("int(11) default 0 comment '流水金额'"))
    private Integer journalAmount;

    @Column(name = "discount_price", columnDefinition = ("int(10) default 0 comment '优惠金额'"))
    private Integer discountPrice;

    @Column(name = "handing_fee", columnDefinition = ("int(10) default 0 comment '手续费'"))
    private Integer handingFee;

    @Column(name = "settlement_amount", columnDefinition = ("int(10) default 0 comment '结算金额'"))
    private Integer settlementAmount;

    @Column(name = "merchant_id", columnDefinition = ("varchar(40) not null comment '商家id'"))
    private String merchantId;

    @Enumerated(EnumType.STRING)
    @Column(name = "pay_platform", columnDefinition = ("varchar(30) default null comment '支付渠道'"))
    private PayPlatform payPlatform;
}
